<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>8box &raquo; <?php if(!empty($title_page)) echo $title_page?></title>
        <link sizes="16x16" type="image/png" href="<?php echo BASE_URL?>img/favicon.png" rel="icon">
        <script type="text/javascript" src="<?php echo BASE_URL?>js/style.js"></script>
        <script type="text/javascript" src="<?php echo BASE_URL?>js/peel.js"></script>
        <link type="text/css" rel="stylesheet" href="<?php echo BASE_URL?>css/header1.css" />
    </head>
    <body onload="randomlike(); randomkomen(); inisialisasi();loadContent('init')" onclick="hideHint()">
        <!-- ::::::::::::::::::::: START OF HEADER PART ::::::::::::::::::::: -->
<div class="topbox">
    <div class="nav1">
        <div style="display:inline-block"><a id="logoButton" href="<?php echo BASE_URL?>"><img width="130" src="<?php echo BASE_URL?>img/logo.png" alt="logo" /></a></div>
        <div class="right">
            <?php 
                if(isset($_SESSION['login'])){
                    echo '
                    <a class="topbutton myaccount" href="'.BASE_URL.'user_con/profile/'.($_SESSION['id']).'" id="myacctButton" title="Sign Up"></a>
                    <a class="topbutton signout" id="loginButton" alt="Log In" href="'.BASE_URL.'user_con/logout"></a>
                        ';
                }
                else{
                    echo '
                    <a class="topbutton login" id="loginButton" alt="Log In" onclick="showPopup();"></a>
                    <a class="topbutton signup" href="'.BASE_URL.'user_con/register" id="myacctButton" title="Sign Up"></a>
                        ';
                }
            ?>
        </div>
    </div>

    <div class="nav2">
        Just another dropbox application
        <?php if(!empty($_SESSION['nama']))
        echo '<div class="right mini-avatar"><a href="'.BASE_URL.'user_con/profile/'.$_SESSION['id'].'"></a></div>';
        ?>
        <div class="right themes">
        <?php if(!empty($_SESSION['nama'])) echo 'Hello, <a href="'.BASE_URL.'user_con/profile/'.$_SESSION['id'].'">'.$_SESSION['nama'].'</a>';?>
        </div>
    </div>
    <div class="nav3">
        <div id="sort5" class="left"><a href="<?php echo BASE_URL?>">Home</a></div>
        <div class="left"><img src="<?php echo BASE_URL?>img/divide.png" alt="" /></div>
        <?php if(isset($_SESSION['login'])){?>
        <div id="sort2" class="left nav3act"><a href="<?php echo BASE_URL?>user_con/list_user">Users</a></div>
        <div class="left"><img src="<?php echo BASE_URL?>img//divide.png" alt="" /></div>
        <?php }?>
        <form action="<?php echo BASE_URL.'home_con/submit_search'?>" method="post" name="srch">
            <div class="right searchbutton">
                <input id="filtersearch" type="submit" name="search_button" onclick="input_search()" value="Search"/>
            </div>
            <div class="right">
                <div id="applesearch">
                    <span class="sbox_l"></span>
                    <span class="sbox">
                        <input style="outline-width:0px;" type="text" name="search_input" id="srch_fld_input" hidden />
                        <input style="outline-width:0px;" type="text" name="search" id="srch_fld" placeholder="Search" autosave="applestyle_srch" results="5" onkeyup="showHint('<?php echo BASE_URL?>', this.value)" autocomplete="off"/>
                    </span>
                    <span class="sbox_r" id="srch_clear"></span>
                </div>
            </div>
        </form>
    </div>
</div>
<div id="overlay" onclick="closeAll()"></div>
<div id="popup" class="popup">
    <div class="loginpopout">
        <form action="sdf.php" method="post">
        <!--<form action="<?php echo BASE_URL ?>user_con/validate_login" method="post">-->
        <div class="topbutton">
            <span class="lbox_l"></span>
            <span class="lbox">
                <input type="text" name="username" id="username" placeholder="Username" autosave="applestyle_srch" results="5" onkeyup="validateUsername('<?php echo BASE_URL?>',this.value)" />
            </span>
            <span class="lbox_r" id="srch_clear"></span>
                <span id="status-username"></span>
        </div>
            <div style="font-size:9px;" id="notif_user"></div>
        <div class="topbutton clear">
            <span class="lbox_l"></span>
            <span class="lbox">
                <input type="password" name="password" id="passwd" placeholder="Password" autosave="applestyle_srch" results="5" onkeyup="applesearch.onChange('srch_fld','srch_clear')" />
            </span>
            <span class="lbox_r" id="srch_clear"></span>
                <span id="status-password"></span>
        </div>
        <div style="font-size:9px;" id="notif_login"></div>
            <div id="login-notification"></div>
            <div class="clear">
                <span><a class="closelogin" onclick="closePopUp()"></a></span>
                <span><input type="button" class="loginbutton login" id="loginButton" onclick="validateLogin('<?php echo BASE_URL?>')" value="Log In" /></span>
            </div>
        </form>
    </div>
</div>
<!-- :::::::: POP-UP SEARCH BAR ::::::: -->
<div class="search-pop-up">
    <ul id="suggestion">
        <li></li>
    </ul>
</div>
<!-- :::::::::::::::::::::::::::::::::: -->
<div class="ach_popup" id="ach_popup">
    <div class="ach_congrats">Congratulations!</div>
    <div class="ach_text">You have been awarded this achievement</div>
    <div class="achievement">
    </div>
    <div class="ach_close">
        <button value="CLOSE" onclick="closeAchievement()">CLOSE</button>
    </div>
</div>
<!-- ::::::::::::::::::::: ACHIEVEMENT LIST :::::::::::::::::::: -->
<div class="ach_list">
    <div class="ach_box">
        <div class="ach_congrats">Credit</div>
        <div class="ach_scroll">
            <div class="achievement">
                <div class="ach_logo"><img src="'.BASE_URL.'img/achievements/'.$list_achievement[$i]['GAMBAR'].'" alt="" width="50"></div>
                <div class="ach_detail">
                    <div class="ach_name">Alfian Ramadhan</div>
                    <div class="ach_how">13509078</div>
                </div>
            </div>
            <div class="achievement">
                <div class="ach_logo"><img src="'.BASE_URL.'img/achievements/'.$list_achievement[$i]['GAMBAR'].'" alt="" width="50"></div>
                <div class="ach_detail">
                    <div class="ach_name">Novan Parmonangan</div>
                    <div class="ach_how">13509xxx</div>
                </div>
            </div>
            <div class="achievement">
                <div class="ach_logo"><img src="'.BASE_URL.'img/achievements/'.$list_achievement[$i]['GAMBAR'].'" alt="" width="50"></div>
                <div class="ach_detail">
                    <div class="ach_name">Reinhard Denis</div>
                    <div class="ach_how">13509xxx</div>
                </div>
            </div>
        </div>
        <div class="ach_close">
            <button value="CLOSE" onclick="slideUp()">CLOSE</button>
        </div>
    </div>
    <div class="ach_notif-center" onclick="slideDown()">ACHIEVEMENTS</div>
</div>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- :::::::::::::::::::::::::: INBOX :::::::::::::::::::::::::: -->
<?php if(!empty($_SESSION['login'])){?>
<div id="inbox">
    <div class="mail">
        <div class="mail-list">
            <div class="headertext inbox-title">INBOX</div>
            <div class="messages">
                <?php 
                    if(!empty($message_box)){
                        for($i=0;$i<count($message_box);$i++){
                            echo '
                                <div class="message" onclick="getContentMessage(\''.BASE_URL.'\','.$message_box[$i]['ID_MESSAGE'].')">
                                    <div class="message-sender">'.$message_box[$i]['NAMA'].'</div>
                                    <div class="message-time">'.$message_box[$i]['WAKTU'].'</div>
                                </div>
                                ';
                        }
                    }
                ?>
            </div>
        </div>
        <div class="mail-body" id="mail-body">
            <?php if(!empty($message_box)) echo $message_box[0]['ISI']?>
        </div>
    </div>
    <div class="slide-inbox" onclick="showInbox()"></div>
</div>
<?php }?>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::: COMPOSE MESSAGE ::::::::::::::::::::: -->
<?php if(!empty($user['ID_USER'])) {?>
<div class="compose">
    <form name="create-message" action="<?php echo BASE_URL.'home_con/insertContentMessage/'.$user['ID_USER']?>" method="post">
        <div class="compose-logo"></div>
        <div class="compose-title clearfix">Compose New Message</div>
        <div class="compose-message">
            <textarea rows="11" cols="59" name="private-message" id="compose_input" placeholder="Write your message here"></textarea>
        </div>
        <div class="send">
                <input type="submit" name="send" value="">
        </div>
    </form>
</div>
<?php }?>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<script type="text/javascript" src="<?php echo BASE_URL?>js/divPop.js"></script>
<script type="text/javascript" src="<?php echo BASE_URL?>js/ajax.js"></script>
<!-- ::::::::::::::::::::: END OF HEADER PART ::::::::::::::::::::: -->